
#include <fstream>
#include <string>
#include <iostream>
#include <sstream>
using namespace std;
int main(int argc, char const *argv[])
{
    string acc;
    cout << argv[1] << endl;
    cout << argv[2] << endl;
    ifstream in;
    in.open(argv[1]);
    ofstream out;
    out.open((argv[2]), ofstream::app);

    if (out)
    {
        cout << "succeed" << endl;
        while (getline(in, acc))
        {
            string name, word;
            istringstream record(acc);
            record >> name;
            // name << record;
            // acc >> name;
            while (record >> word)
            {
                cout << "name is " << name << " word is " << word << endl;
            }

            // cout << endl;
            // cout << acc << endl;
        }
    }
    in.close();
    out.close();
    cout << "succeed endl" << endl;
}
